<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DelUnitSettledApplyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('unit_settled_apply');

        //单位认证
        Schema::create('unit_settled_apply', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('name')->nullable()->comment('单位名称');
            $table->string('province',64)->nullable()->comment('省份');
            $table->string('city',64)->nullable()->comment('城市');
            $table->string('area',64)->nullable()->comment('地区');
            $table->string('address')->nullable()->comment('详细地址');
            $table->string('uniform_social_credit_code')->nullable()->comment('统一社会信用代码');
            $table->string('introduction')->nullable()->comment('企业简介');
            $table->string('contact_number')->nullable()->comment('联系电话');
            $table->string('legal_person_name')->nullable()->comment('法人姓名');
            $table->integer('license_img_id')->default(0)->comment('营业执照照片');
            $table->integer('status')->default(0)->comment('审核状态 0：待处理 1：通过 2：拒绝');
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::table('unit_business_label', function(Blueprint $table)
        {
            $table->integer('unit_settled_apply_id')->default(0)->comment('单位入驻申请id')->after('unit_id');
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
